package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.nursing.service.IReservationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 预约信息Controller
 *
 * @author elina
 * @date 2025-10-15
 */
@Api(tags = "预约信息管理")
@RestController
@RequestMapping("/member/reservation/")
public class ReservationController extends BaseController {

    @Autowired
    private IReservationService reservationService;

    @ApiOperation("查询当天取消预约数量")
    @GetMapping("/cancelled-count")
    public AjaxResult getCancelReservationCount() {
        return success(reservationService.getCancelReservationCount());
    }

    @ApiOperation("查询每个时间段剩余预约次数")
    @GetMapping("/countByTime")
    public AjaxResult getReservationCount(Long time) {
        return success(reservationService.getReservationCount(time));
    }
}
